package com.zrfintech.core.service.product.impl;

import com.alibaba.fastjson.JSONObject;
import com.zrfintech.common.RequestContext;
import com.zrfintech.core.service.product.ProductService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service("default")
public class ProductServiceImpl implements ProductService {

//    private Logger logger = LoggerFactory.getLogger(ProductServiceImpl.class);
    private static Logger LOGGER = LoggerFactory.getLogger(ProductServiceImpl.class);

    @Override
    public Object productOutput(JSONObject reqObj) {
        RequestContext.setSecondContext("ymParam","param1");
        LOGGER.info("default is running===========");
        JSONObject jsonObject = new JSONObject();

        RequestContext.setSecondContext("ymParam2","param2");
        jsonObject.put("matchTag", 1);
        jsonObject.put("score", 0.05);
        return jsonObject;
    }

    @Override
    public Object defaultResult(JSONObject reqObj) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("matchTag", 0);
        jsonObject.put("score", null);
        return jsonObject;
    }
}
